package com.zzy.controller;

import com.zzy.model.AjaxMsg;
import com.zzy.model.BlobEntity;
import com.zzy.model.MenuEntity;
import com.zzy.model.ParamVO;
import com.zzy.service.BlobService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/test/")
public class TestController {

    @Resource
    private BlobService blobService;
    private final static Logger logger = LoggerFactory.getLogger(TestController.class);
    // 对面直接传递参数
    @ResponseBody
    @RequestMapping("a")
    public AjaxMsg loginTest(){
        List<BlobEntity> list = blobService.findAll();
        logger.info("测试日志"+System.currentTimeMillis());
        return AjaxMsg.returnAjaxMsg(list);
    }

    @ResponseBody
    @RequestMapping("b")
    public AjaxMsg b(){
        List list = blobService.findAllMap();
        return AjaxMsg.returnAjaxMsg(list);
    }


    @ResponseBody
    @RequestMapping("save")
    public AjaxMsg save(){
        BlobEntity model = new BlobEntity();
        return AjaxMsg.returnAjaxMsg( blobService.save(model));
    }





}
